#include <iostream>



/**
 * 
 * 彩票
 * 
 * 
 */
int main() {

    int a, b;
    std::cin >> a >> b;

    if (a == b) {
        std::cout << 100;
        return 0;
    }


    int a1 = a % 10;
    int a2 = a / 10;

    int b1 = b % 10;
    int b2 = b / 10;

    if ((a1==b1 && a2 ==b2) ||
        (a1==b2 && a2 == b1)) {
        std::cout << 20;
        return 0;
    }


    if ((a1==b1 && a2 != b2) ||
        (a1 == b2 && a2 != b1) ||
        (a2 == b1 && a1 != b2) ||
        (a2 == b2  && a1  != b1)) {
        std::cout << 2;
        return 0;
    }

    std::cout << 0;
   
    return 0;
}